#图书管理系统
class Book:
    def __init__(self,title,author,isbn):
        self.title = title
        self.author = author
        self.isbn = isbn

class Library:
    def __init__(self):
        self.books = []

    def add_book(self,title,author,isbn):
        new_book = Book(title,author,isbn)
        self.books.append(new_book)
        print(f"book'{new_book.title}'by'{new_book.author}'加入图书列表")

    def remove_book(self,title):
        for book in self.books:
            if book.title == title:
                self.books.remove(book)
                print(f"book'{book.title}'by'{book.author}'从图书列表中删除")
                return
        print(f"book'{title}'未找到")

    def find_book(self,title):
        for book in self.books:
            if book.title == title:
                print(f"book'{book.title}'by'{book.author}'with isbn'{book.isbn}'")
                return
        print(f"book'{title}'未找到")

    def list_books(self):
        if self.books:
            for book in self.books:
                print(f"title:'{book.title}',author:'{book.author}',isbn:'{book.isbn}'")
            print("列表结尾")
        else:
            print("图书列表为空")


if __name__ == "__main__":
    library = Library()
    library.add_book("book1","author1","123456")
    library.add_book("book2","author2","123457")
    library.add_book("book3","author3","123458")
    library.list_books()
    library.remove_book("book2")
    library.list_books()
    library.find_book("book3")
    library.find_book("book4")






